{itemplate 'public/header'}
<script type='text/javascript' src='{WE7_WMALL_URL}static/js/components/light7/iscroll-probe.js' charset='utf-8'></script>
<div class="page store shopcategory" id="page-app-goods">
	<nav class="bar bar-tab no-gutter shop-cart-bar">
		<div class="" id="cartEmpty">
			<div class="left empty">
				<span class="cart">
					<span class="icon icon-cart"></span>
				</span>
				购物车是空的
			</div>
			<div class="right text-center bg-grey">{$store['send_price']}元起送</div>
		</div>
		<div class="hide" id="cartNotEmpty">
			<div class="left">
				<span class="cart">
					<span class="icon icon-cart"></span>
					<span class="badge bg-danger" id="cartNum">0</span>
				</span>
				共<span class="sum">￥<span id="totalPrice">0</span>元</span>
			</div>
			<div class="right text-center bg-grey" id="categoryCondition">还差￥0元起送</div>
			<div class="right text-center bg-grey">还差￥<span id="sendCondition">{$store['send_price']}</span>元起送</div>
			<div class="right text-center bg-danger hide" id="btnSubmit">选好了</div>
		</div>
	</nav>
	{if !empty($activity['items']['discount'])}
		<div class="store-discount-notice">
			<div class="inner">{$activity['items']['discount']['title']}</div>
		</div>
	{elseif !empty($activity['items']['grant'])}
		<div class="store-discount-notice">
			<div class="inner">{$activity['items']['grant']['title']}</div>
		</div>
	{/if}
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left back" href="javascript:;"><i class="icon icon-arrow-left"></i></a>
		<h1 class="title open-popup" data-popup=".popup-privilege">{$store['title']}</h1>
		<a class="pull-right" href="javascript:;" style="margin-left: 5px"><i class="icon icon-search"></i></a>
		<a class="pull-right" href="javascript:;" id="btn-favorite" data-id="{$store['id']}" data-uid="{$_W['member']['uid']}"><i class="fa {if !empty($is_favorite)}icon icon-favorfill{else}icon icon-favor{/if}"></i></a>
	</header>
	<div class="store-notice open-popup" data-popup=".popup-privilege">
		<span class="js-scroll-notice">
			<span class="icon icon-voice"></span>
			{if !empty($store['notice'])}
				{$store['notice']}
			{else}
				营业时间: {$store['business_hours_cn']}
			{/if}
		</span>
	</div>
	<div class="buttons-tab">
		<a href="{php echo imurl('wmall/store/goods', array('sid' => $store['id']));}" class="button active">商品</a>
		<a href="{php echo imurl('wmall/store/comment', array('sid' => $store['id']));}" class="button">评价</a>
		<a href="{php echo imurl('wmall/store/index', array('sid' => $store['id']));}" class="button">车主</a>
		{if !empty($store['sns']['qq'])}
			<a href="http://wpa.qq.com/msgrd?v=3&uin={$store['sns']['qq']}&site=qq&menu=yes" class="button">客服</a>
		{/if}
	</div>
	<div class="parent-category-wrapper">
		<div class="parent-category">
			<div id="cateMenu">
				<ul class="category-list">
					{loop $categorys $category}
						{if !empty($cate_goods[$category['id']])}
							<li class="border-1px-b">
								<a href="javascript:;">
									{if $category['bargain_id'] > 0}
										<svg class="svg" aria-hidden="true">
											<use xlink:href="#svg-tag"></use>
										</svg>
									{/if}
									{$category['title']}
								</a>
							</li>
						{/if}
					{/loop}
				</ul>
			</div>
		</div>
	</div>
	<div class="content lazyload-container">
		<div class="category-container row no-gutter" style="padding-left: 20%">
			{if !empty($tokens)}
				<div class="coupon-show-container">
					<div class="coupon-show">
						<div class="coupon-sum">
							<span>￥</span>{$token_price}
						</div>
						<div class="division">
							<img src="{WE7_WMALL_TPL_URL}static/img/division.png" alt="" />
						</div>
						<div class="coupon-info">
							<div class="coupon-title">车主代金券</div>
							{if $token_nums > 1}
								<div class="condition">内含{$token_nums}张券</div>
							{else}
								<div class="condition">满{$token['condition']}元可用</div>
							{/if}
						</div>
						<div class="get">
							<span class="btn-get" id="get-coupon">领券</span>
						</div>
					</div>
				</div>
			{/if}
		</div>
		<div class="category-container row no-gutter" id="category-container">
			<div class="children-category col-100">
				<form action="{php echo imurl('wmall/order/create/goods', array('sid' => $sid));}" method="post" id="goods-form">
					<input type="hidden" name="goods" value=""/>
					{loop $categorys $cate_row}
						{if !empty($cate_goods[$cate_row['id']])}
						<div class="children-category-wrapper">
							<div class="heading"><span>{$cate_row['title']}</span> {if $cate_row['min_fee'] > 0}<small>最低消费{$cate_row['min_fee']}元</small>{/if}</div>
							<ul class="list-block media-list goods-new-index">
								{loop $cate_goods[$cate_row['id']] $ds}
									<li id="goods-{$ds['id']}" {if $_GPC['goods_id'] == $ds['id']}class="active"{/if}>
										<a class="item-content goods-popup" data-id="{$ds['id']}" href="javascript:;">
											<div class="item-inner">
												<div class="item-title-row">
													<img src="{WE7_WMALL_TPL_URL}static/img/hm.gif" class="lazyload" data-original="{php echo tomedia($ds['thumb']);}" alt=""/>
													<div class="sell-info">已售{$ds['sailed']}{$ds['unitname']}&nbsp;&nbsp; 好评{$ds['comment_good']}</div>
													{if !empty($ds['label'])}
														<span class="tag tag-danger">{$ds['label']}</span>
													{/if}
												</div>
												<div class="item-subtitle">{$ds['title']}</div>
												<div class="item-text">{$ds['content']}</div>
												<div class="price">
													<span class="fee"><span>￥</span>{$ds['discount_price']}</span>
													{if !empty($ds['bargain_id'])}
														<span class="original-fee">￥{$ds['price']}</span>
													{/if}
												</div>
												{if !empty($ds['discount'])}
												<span class="tag tag-danger">{if $ds['poi_user_type'] == 'new'}新用户专享{/if} {$ds['discount']}折 每单仅限{$ds['max_buy_limit']}份</span>
												{/if}
											</div>
										</a>
										{if $store['is_in_business_hours']}
											{if !$ds['is_options'] && !$ds['is_attrs']}
												{if !$ds['discount_available_total'] && !$ds['total']}
													<div class="goods-tips">已售完</div>
												{else}
													<div class="operate-num operate-goods">
														<span class="hide minus">
															<span class="icon icon-minus" data-goods-id="{$ds['id']}" data-option-id="0"></span>
															<span class="num">0</span>
														</span>
														<span class="icon icon-plus" data-goods-id="{$ds['id']}" data-option-id="0"></span>
													</div>
												{/if}
											{elseif $ds['is_options'] == 1 || $ds['is_attrs'] == 1}
												<div class="operate-goods">
													<span class="select-spec goods-option" data-id="{$ds['id']}">可选规格</span>
												</div>
											{/if}
										{else}
											<div class="goods-tips">店铺休息中</div>
										{/if}
									</li>
								{/loop}
							</ul>
						</div>
						{/if}
					{/loop}
				</form>
			</div>
		</div>
	</div>
</div>
{itemplate 'store/goodsCommon'}
{itemplate 'public/footer'}